ArrowCDEF is a CDEF that implements an up-down arrow like those seen in the color picker. It supports the ability to use any PICT resource as the arrow, so you can make your arrows look however you like. There is both a black & white and a color set of PICT's in "ArrowCDEF Tester.π.rsrc" which you can use if you don't want to design you own.
Using ArrowCDEF
---------------
To use ArrowCDEF, just include the CDEF in your program's resource file and add it to your window or dialog. The reference constant of the control should contain the resource ID of an 'APIC' resource, which tells the control which PICT resources should be used to draw the arrow in each of it's four states. There should be a PICT resource for when the up arrow is pressed, when the down arrow is pressed, when no arrows are pressed and when the arrow is inactive. There is a TMPL resource in "ArrowCDEF Tester.π.rsrc" for editing 'APIC' resources.
ArrowCDEF only draws the arrow, it does not draw an indicator, or value of any kind. The application is responsible for updating and displaying any kind of value. See "ArrowCDEF Tester.c" for an example of how an action procedure is used to change and display the value of a control. ArrowCDEF uses the same part codes as the scroll bars. When the up arrow is pressed, "inUpButton" is the part code returned. "inDownButton" the part code returned when the down arrow is pressed.
The file "ArrowCDEF.h" defines some useful constants such as the CDEF resource ID, the control definition ID, the resource type that describes which PICTs to use for the arrow.
Acknowledgements
-----------------
Thanks to Eddy J. Gurney for helping a novice to Macintosh programming (me) and for showing me that Geneva 9 pt is a really cool font to program in!